{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "table1 = pd.read_excel('F:\\研\\数模\\建模2023\\E题\\竞赛发布数据\\表1-患者列表及临床信息.xlsx') "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "new_df = table1.copy()\n",
    "# 将血压列按斜杠分割成高压和低压，并存储到新列中\n",
    "new_df[['高压', '低压']] = table1['血压'].str.split('/', expand=True)\n",
    "\n",
    "# 将高压和低压的数据类型更改为数值类型（float）\n",
    "new_df['高压'] = new_df['高压'].astype(float)\n",
    "new_df['低压'] = new_df['低压'].astype(float)\n",
    "\n",
    "new_df.to_excel('F:\\研\\数模\\建模2023\\E题\\竞赛发布数据\\表1-患者列表及临床信息更新后.xlsx', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "table1 = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/表1-患者列表及临床信息更新后.xlsx') \n",
    "table2 = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/处理后的表216.13.xlsx')\n",
    "table3 = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/表3-患者影像信息血肿及水肿的形状及灰度分布.xlsx', sheet_name='ED')\n",
    "table4 = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/表3-患者影像信息血肿及水肿的形状及灰度分布.xlsx', sheet_name='Hemo')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "table1_categorical_features = ['性别', '高血压病史', '卒中病史', '糖尿病史', '房颤史', '冠心病史', '吸烟史', '饮酒史', '脑出血前mRS评分'\n",
    "                               ,'脑室引流','止血治疗', '降颅压治疗', '镇静、镇痛治疗', '止吐护胃', '营养神经']\n",
    "table1 = pd.get_dummies(table1, columns=table1_categorical_features, drop_first=True)\n",
    "table1_columns_to_normalize = ['年龄', '高压', '低压','发病到首次影像检查时间间隔']\n",
    "scaler = StandardScaler()\n",
    "table1[table1_columns_to_normalize] = scaler.fit_transform(table1[table1_columns_to_normalize])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>90天mRS</th>\n",
       "      <th>数据集划分</th>\n",
       "      <th>入院首次影像检查流水号</th>\n",
       "      <th>年龄</th>\n",
       "      <th>发病到首次影像检查时间间隔</th>\n",
       "      <th>血压</th>\n",
       "      <th>降压治疗</th>\n",
       "      <th>高压</th>\n",
       "      <th>低压</th>\n",
       "      <th>...</th>\n",
       "      <th>饮酒史_1</th>\n",
       "      <th>脑出血前mRS评分_1</th>\n",
       "      <th>脑出血前mRS评分_2</th>\n",
       "      <th>脑出血前mRS评分_3</th>\n",
       "      <th>脑室引流_1</th>\n",
       "      <th>止血治疗_1</th>\n",
       "      <th>降颅压治疗_1</th>\n",
       "      <th>镇静、镇痛治疗_1</th>\n",
       "      <th>止吐护胃_1</th>\n",
       "      <th>营养神经_1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sub001</td>\n",
       "      <td>4.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>-1.517819</td>\n",
       "      <td>-0.248782</td>\n",
       "      <td>180/90</td>\n",
       "      <td>1</td>\n",
       "      <td>0.397763</td>\n",
       "      <td>-0.285148</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sub002</td>\n",
       "      <td>0.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20160406002131</td>\n",
       "      <td>-0.438801</td>\n",
       "      <td>-0.139799</td>\n",
       "      <td>199/120</td>\n",
       "      <td>1</td>\n",
       "      <td>1.128397</td>\n",
       "      <td>1.492398</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sub003</td>\n",
       "      <td>5.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20160413000006</td>\n",
       "      <td>0.999890</td>\n",
       "      <td>-0.357765</td>\n",
       "      <td>199/120</td>\n",
       "      <td>1</td>\n",
       "      <td>1.128397</td>\n",
       "      <td>1.492398</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sub004</td>\n",
       "      <td>4.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161215001667</td>\n",
       "      <td>0.424414</td>\n",
       "      <td>-0.575732</td>\n",
       "      <td>186/99</td>\n",
       "      <td>1</td>\n",
       "      <td>0.628489</td>\n",
       "      <td>0.248116</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sub005</td>\n",
       "      <td>3.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161222000978</td>\n",
       "      <td>-0.942342</td>\n",
       "      <td>0.296135</td>\n",
       "      <td>135/92</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.332686</td>\n",
       "      <td>-0.166645</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>155</th>\n",
       "      <td>sub156</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200306000927</td>\n",
       "      <td>1.647301</td>\n",
       "      <td>0.405119</td>\n",
       "      <td>202/100</td>\n",
       "      <td>1</td>\n",
       "      <td>1.243760</td>\n",
       "      <td>0.307367</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>sub157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20201009003102</td>\n",
       "      <td>-0.870408</td>\n",
       "      <td>-0.684716</td>\n",
       "      <td>180/110</td>\n",
       "      <td>1</td>\n",
       "      <td>0.397763</td>\n",
       "      <td>0.899883</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>sub158</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200410001952</td>\n",
       "      <td>-0.510735</td>\n",
       "      <td>-0.183392</td>\n",
       "      <td>233/135</td>\n",
       "      <td>1</td>\n",
       "      <td>2.435847</td>\n",
       "      <td>2.381171</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>sub159</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>-1.230081</td>\n",
       "      <td>-0.139799</td>\n",
       "      <td>183/122</td>\n",
       "      <td>1</td>\n",
       "      <td>0.513126</td>\n",
       "      <td>1.610901</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>sub160</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>1.143759</td>\n",
       "      <td>0.078168</td>\n",
       "      <td>208/95</td>\n",
       "      <td>1</td>\n",
       "      <td>1.474486</td>\n",
       "      <td>0.011110</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>160 rows × 27 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         ID  90天mRS 数据集划分     入院首次影像检查流水号        年龄  发病到首次影像检查时间间隔       血压  \\\n",
       "0    sub001     4.0    训练  20161212002136 -1.517819      -0.248782   180/90   \n",
       "1    sub002     0.0    训练  20160406002131 -0.438801      -0.139799  199/120   \n",
       "2    sub003     5.0    训练  20160413000006  0.999890      -0.357765  199/120   \n",
       "3    sub004     4.0    训练  20161215001667  0.424414      -0.575732   186/99   \n",
       "4    sub005     3.0    训练  20161222000978 -0.942342       0.296135   135/92   \n",
       "..      ...     ...   ...             ...       ...            ...      ...   \n",
       "155  sub156     NaN   测试2  20200306000927  1.647301       0.405119  202/100   \n",
       "156  sub157     NaN   测试2  20201009003102 -0.870408      -0.684716  180/110   \n",
       "157  sub158     NaN   测试2  20200410001952 -0.510735      -0.183392  233/135   \n",
       "158  sub159     NaN   测试2  20200218000582 -1.230081      -0.139799  183/122   \n",
       "159  sub160     NaN   测试2  20200821002584  1.143759       0.078168   208/95   \n",
       "\n",
       "     降压治疗        高压        低压  ...  饮酒史_1  脑出血前mRS评分_1  脑出血前mRS评分_2  \\\n",
       "0       1  0.397763 -0.285148  ...      0            0            0   \n",
       "1       1  1.128397  1.492398  ...      0            0            0   \n",
       "2       1  1.128397  1.492398  ...      0            0            0   \n",
       "3       1  0.628489  0.248116  ...      0            0            1   \n",
       "4       0 -1.332686 -0.166645  ...      0            0            0   \n",
       "..    ...       ...       ...  ...    ...          ...          ...   \n",
       "155     1  1.243760  0.307367  ...      0            0            0   \n",
       "156     1  0.397763  0.899883  ...      0            0            1   \n",
       "157     1  2.435847  2.381171  ...      0            0            0   \n",
       "158     1  0.513126  1.610901  ...      1            0            0   \n",
       "159     1  1.474486  0.011110  ...      0            0            0   \n",
       "\n",
       "     脑出血前mRS评分_3  脑室引流_1  止血治疗_1  降颅压治疗_1  镇静、镇痛治疗_1  止吐护胃_1  营养神经_1  \n",
       "0              0       0       1        1          1       1       1  \n",
       "1              0       0       1        1          0       1       1  \n",
       "2              0       0       1        1          1       1       1  \n",
       "3              0       0       1        1          0       0       0  \n",
       "4              0       0       1        1          0       1       1  \n",
       "..           ...     ...     ...      ...        ...     ...     ...  \n",
       "155            0       0       1        1          0       1       1  \n",
       "156            0       1       0        1          1       1       1  \n",
       "157            0       0       1        1          1       1       1  \n",
       "158            0       0       1        1          1       1       1  \n",
       "159            0       1       1        1          1       1       1  \n",
       "\n",
       "[160 rows x 27 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "table2_columns_to_normalize = ['HM_volume', 'ED_volume','HM_ACA_R_Ratio',\n",
    "                            'HM_MCA_R_Ratio','HM_PCA_R_Ratio','HM_Pons_Medulla_R_Ratio','HM_Cerebellum_R_Ratio',\n",
    "                            'HM_ACA_L_Ratio','HM_MCA_L_Ratio', 'HM_PCA_L_Ratio','HM_Pons_Medulla_L_Ratio',\n",
    "                            'HM_Cerebellum_L_Ratio','ED_ACA_R_Ratio','ED_MCA_R_Ratio','ED_PCA_R_Ratio',\n",
    "                            'ED_Pons_Medulla_R_Ratio','ED_Cerebellum_R_Ratio','ED_ACA_L_Ratio','ED_MCA_L_Ratio',\n",
    "                            'ED_PCA_L_Ratio','ED_Pons_Medulla_L_Ratio','ED_Cerebellum_L_Ratio']\n",
    "table2[table2_columns_to_normalize] = scaler.fit_transform(table2[table2_columns_to_normalize])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>ID</th>\n",
       "      <th>首次检查流水号</th>\n",
       "      <th>HM_volume</th>\n",
       "      <th>HM_ACA_R_Ratio</th>\n",
       "      <th>HM_MCA_R_Ratio</th>\n",
       "      <th>HM_PCA_R_Ratio</th>\n",
       "      <th>HM_Pons_Medulla_R_Ratio</th>\n",
       "      <th>HM_Cerebellum_R_Ratio</th>\n",
       "      <th>HM_ACA_L_Ratio</th>\n",
       "      <th>...</th>\n",
       "      <th>ED_MCA_R_Ratio</th>\n",
       "      <th>ED_PCA_R_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_R_Ratio</th>\n",
       "      <th>ED_Cerebellum_R_Ratio</th>\n",
       "      <th>ED_ACA_L_Ratio</th>\n",
       "      <th>ED_MCA_L_Ratio</th>\n",
       "      <th>ED_PCA_L_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_L_Ratio</th>\n",
       "      <th>ED_Cerebellum_L_Ratio</th>\n",
       "      <th>检查时间</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>sub001</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>1.107760</td>\n",
       "      <td>-0.360671</td>\n",
       "      <td>1.421207</td>\n",
       "      <td>0.046025</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.997061</td>\n",
       "      <td>0.483266</td>\n",
       "      <td>-0.160550</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2016-12-12 23:32:54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>sub001</td>\n",
       "      <td>20161213000009</td>\n",
       "      <td>1.261933</td>\n",
       "      <td>-0.359472</td>\n",
       "      <td>1.402163</td>\n",
       "      <td>0.076752</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>1.151097</td>\n",
       "      <td>0.123617</td>\n",
       "      <td>-0.151719</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2016-12-13 05:19:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>sub001</td>\n",
       "      <td>20161218000100</td>\n",
       "      <td>1.144550</td>\n",
       "      <td>-0.345520</td>\n",
       "      <td>1.267265</td>\n",
       "      <td>0.284563</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.876444</td>\n",
       "      <td>0.592537</td>\n",
       "      <td>0.019588</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2016-12-18 09:09:24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>sub001</td>\n",
       "      <td>20161223001020</td>\n",
       "      <td>0.903216</td>\n",
       "      <td>-0.309019</td>\n",
       "      <td>1.232518</td>\n",
       "      <td>0.344447</td>\n",
       "      <td>-0.204969</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.651729</td>\n",
       "      <td>0.528162</td>\n",
       "      <td>0.370401</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2016-12-23 16:47:09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3</td>\n",
       "      <td>sub001</td>\n",
       "      <td>20161230000574</td>\n",
       "      <td>0.344473</td>\n",
       "      <td>-0.359704</td>\n",
       "      <td>1.314698</td>\n",
       "      <td>0.227331</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.842174</td>\n",
       "      <td>0.403984</td>\n",
       "      <td>0.357665</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679313</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2016-12-30 14:35:12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>586</td>\n",
       "      <td>sub158</td>\n",
       "      <td>20200423000871</td>\n",
       "      <td>-0.855568</td>\n",
       "      <td>-0.363698</td>\n",
       "      <td>1.627275</td>\n",
       "      <td>-0.360425</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>1.254171</td>\n",
       "      <td>0.203144</td>\n",
       "      <td>-0.104837</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2020-04-23 11:31:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>590</td>\n",
       "      <td>sub159</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>0.615643</td>\n",
       "      <td>-0.363698</td>\n",
       "      <td>-0.827225</td>\n",
       "      <td>-0.582898</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.298516</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.973949</td>\n",
       "      <td>-0.655705</td>\n",
       "      <td>-0.160550</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>0.627017</td>\n",
       "      <td>1.098335</td>\n",
       "      <td>0.775853</td>\n",
       "      <td>0.173185</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2020-02-18 15:29:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>589</td>\n",
       "      <td>sub159</td>\n",
       "      <td>20200219000588</td>\n",
       "      <td>2.799503</td>\n",
       "      <td>-0.305461</td>\n",
       "      <td>-0.826779</td>\n",
       "      <td>-0.563140</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>0.668541</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.969240</td>\n",
       "      <td>-0.465753</td>\n",
       "      <td>0.015094</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>1.625314</td>\n",
       "      <td>-0.079134</td>\n",
       "      <td>2.127615</td>\n",
       "      <td>0.952454</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2020-02-19 15:01:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>592</td>\n",
       "      <td>sub160</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>0.492762</td>\n",
       "      <td>-0.363698</td>\n",
       "      <td>1.499118</td>\n",
       "      <td>-0.099368</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.871422</td>\n",
       "      <td>-0.101926</td>\n",
       "      <td>-0.160550</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2020-08-21 22:32:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>591</td>\n",
       "      <td>sub160</td>\n",
       "      <td>20200822000947</td>\n",
       "      <td>2.021743</td>\n",
       "      <td>0.000539</td>\n",
       "      <td>1.295102</td>\n",
       "      <td>0.041791</td>\n",
       "      <td>-0.206634</td>\n",
       "      <td>-0.129136</td>\n",
       "      <td>-0.352784</td>\n",
       "      <td>...</td>\n",
       "      <td>0.144082</td>\n",
       "      <td>0.841764</td>\n",
       "      <td>-0.160550</td>\n",
       "      <td>-0.12162</td>\n",
       "      <td>-0.502544</td>\n",
       "      <td>-0.873068</td>\n",
       "      <td>-0.679497</td>\n",
       "      <td>-0.209774</td>\n",
       "      <td>-0.085839</td>\n",
       "      <td>2020-08-22 12:01:00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Unnamed: 0      ID         首次检查流水号  HM_volume  HM_ACA_R_Ratio  \\\n",
       "0             0  sub001  20161212002136   1.107760       -0.360671   \n",
       "1             4  sub001  20161213000009   1.261933       -0.359472   \n",
       "2             1  sub001  20161218000100   1.144550       -0.345520   \n",
       "3             2  sub001  20161223001020   0.903216       -0.309019   \n",
       "4             3  sub001  20161230000574   0.344473       -0.359704   \n",
       "..          ...     ...             ...        ...             ...   \n",
       "588         586  sub158  20200423000871  -0.855568       -0.363698   \n",
       "589         590  sub159  20200218000582   0.615643       -0.363698   \n",
       "590         589  sub159  20200219000588   2.799503       -0.305461   \n",
       "591         592  sub160  20200821002584   0.492762       -0.363698   \n",
       "592         591  sub160  20200822000947   2.021743        0.000539   \n",
       "\n",
       "     HM_MCA_R_Ratio  HM_PCA_R_Ratio  HM_Pons_Medulla_R_Ratio  \\\n",
       "0          1.421207        0.046025                -0.206634   \n",
       "1          1.402163        0.076752                -0.206634   \n",
       "2          1.267265        0.284563                -0.206634   \n",
       "3          1.232518        0.344447                -0.204969   \n",
       "4          1.314698        0.227331                -0.206634   \n",
       "..              ...             ...                      ...   \n",
       "588        1.627275       -0.360425                -0.206634   \n",
       "589       -0.827225       -0.582898                -0.206634   \n",
       "590       -0.826779       -0.563140                -0.206634   \n",
       "591        1.499118       -0.099368                -0.206634   \n",
       "592        1.295102        0.041791                -0.206634   \n",
       "\n",
       "     HM_Cerebellum_R_Ratio  HM_ACA_L_Ratio  ...  ED_MCA_R_Ratio  \\\n",
       "0                -0.129136       -0.352784  ...        0.997061   \n",
       "1                -0.129136       -0.352784  ...        1.151097   \n",
       "2                -0.129136       -0.352784  ...        0.876444   \n",
       "3                -0.129136       -0.352784  ...        0.651729   \n",
       "4                -0.129136       -0.352784  ...        0.842174   \n",
       "..                     ...             ...  ...             ...   \n",
       "588              -0.129136       -0.352784  ...        1.254171   \n",
       "589              -0.129136       -0.298516  ...       -0.973949   \n",
       "590              -0.129136        0.668541  ...       -0.969240   \n",
       "591              -0.129136       -0.352784  ...        0.871422   \n",
       "592              -0.129136       -0.352784  ...        0.144082   \n",
       "\n",
       "     ED_PCA_R_Ratio  ED_Pons_Medulla_R_Ratio  ED_Cerebellum_R_Ratio  \\\n",
       "0          0.483266                -0.160550               -0.12162   \n",
       "1          0.123617                -0.151719               -0.12162   \n",
       "2          0.592537                 0.019588               -0.12162   \n",
       "3          0.528162                 0.370401               -0.12162   \n",
       "4          0.403984                 0.357665               -0.12162   \n",
       "..              ...                      ...                    ...   \n",
       "588        0.203144                -0.104837               -0.12162   \n",
       "589       -0.655705                -0.160550               -0.12162   \n",
       "590       -0.465753                 0.015094               -0.12162   \n",
       "591       -0.101926                -0.160550               -0.12162   \n",
       "592        0.841764                -0.160550               -0.12162   \n",
       "\n",
       "     ED_ACA_L_Ratio  ED_MCA_L_Ratio  ED_PCA_L_Ratio  ED_Pons_Medulla_L_Ratio  \\\n",
       "0         -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "1         -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "2         -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "3         -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "4         -0.502544       -0.873068       -0.679313                -0.209774   \n",
       "..              ...             ...             ...                      ...   \n",
       "588       -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "589        0.627017        1.098335        0.775853                 0.173185   \n",
       "590        1.625314       -0.079134        2.127615                 0.952454   \n",
       "591       -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "592       -0.502544       -0.873068       -0.679497                -0.209774   \n",
       "\n",
       "     ED_Cerebellum_L_Ratio                检查时间  \n",
       "0                -0.085839 2016-12-12 23:32:54  \n",
       "1                -0.085839 2016-12-13 05:19:00  \n",
       "2                -0.085839 2016-12-18 09:09:24  \n",
       "3                -0.085839 2016-12-23 16:47:09  \n",
       "4                -0.085839 2016-12-30 14:35:12  \n",
       "..                     ...                 ...  \n",
       "588              -0.085839 2020-04-23 11:31:00  \n",
       "589              -0.085839 2020-02-18 15:29:00  \n",
       "590              -0.085839 2020-02-19 15:01:00  \n",
       "591              -0.085839 2020-08-21 22:32:00  \n",
       "592              -0.085839 2020-08-22 12:01:00  \n",
       "\n",
       "[593 rows x 26 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "table3_columns_to_normalize = ['original_shape_Elongation', 'original_shape_Flatness', 'original_shape_LeastAxisLength','original_shape_MajorAxisLength',\n",
    "                               'original_shape_Maximum2DDiameterColumn', 'original_shape_Maximum2DDiameterRow', 'original_shape_Maximum2DDiameterSlice','original_shape_Maximum3DDiameter',\n",
    "                               'original_shape_MeshVolume', 'original_shape_MinorAxisLength', 'original_shape_Sphericity','original_shape_SurfaceArea',\n",
    "                               'original_shape_SurfaceVolumeRatio', 'original_shape_VoxelVolume', 'NCCT_original_firstorder_10Percentile','NCCT_original_firstorder_90Percentile',\n",
    "                               'NCCT_original_firstorder_Energy', 'NCCT_original_firstorder_Entropy', 'NCCT_original_firstorder_InterquartileRange','NCCT_original_firstorder_Kurtosis',\n",
    "                               'NCCT_original_firstorder_Maximum', 'NCCT_original_firstorder_MeanAbsoluteDeviation', 'NCCT_original_firstorder_Mean','NCCT_original_firstorder_Median',\n",
    "                               'NCCT_original_firstorder_Minimum', 'NCCT_original_firstorder_Range', 'NCCT_original_firstorder_RobustMeanAbsoluteDeviation','NCCT_original_firstorder_RootMeanSquared',\n",
    "                               'NCCT_original_firstorder_Skewness', 'NCCT_original_firstorder_Uniformity', 'NCCT_original_firstorder_Variance']\n",
    "table3[table3_columns_to_normalize] = scaler.fit_transform(table3[table3_columns_to_normalize])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>备注</th>\n",
       "      <th>流水号</th>\n",
       "      <th>original_shape_Elongation</th>\n",
       "      <th>original_shape_Flatness</th>\n",
       "      <th>original_shape_LeastAxisLength</th>\n",
       "      <th>original_shape_MajorAxisLength</th>\n",
       "      <th>original_shape_Maximum2DDiameterColumn</th>\n",
       "      <th>original_shape_Maximum2DDiameterRow</th>\n",
       "      <th>original_shape_Maximum2DDiameterSlice</th>\n",
       "      <th>original_shape_Maximum3DDiameter</th>\n",
       "      <th>...</th>\n",
       "      <th>NCCT_original_firstorder_MeanAbsoluteDeviation</th>\n",
       "      <th>NCCT_original_firstorder_Mean</th>\n",
       "      <th>NCCT_original_firstorder_Median</th>\n",
       "      <th>NCCT_original_firstorder_Minimum</th>\n",
       "      <th>NCCT_original_firstorder_Range</th>\n",
       "      <th>NCCT_original_firstorder_RobustMeanAbsoluteDeviation</th>\n",
       "      <th>NCCT_original_firstorder_RootMeanSquared</th>\n",
       "      <th>NCCT_original_firstorder_Skewness</th>\n",
       "      <th>NCCT_original_firstorder_Uniformity</th>\n",
       "      <th>NCCT_original_firstorder_Variance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160117000135</td>\n",
       "      <td>0.826613</td>\n",
       "      <td>0.242068</td>\n",
       "      <td>-0.334582</td>\n",
       "      <td>-0.579651</td>\n",
       "      <td>0.486115</td>\n",
       "      <td>-0.222715</td>\n",
       "      <td>-0.445211</td>\n",
       "      <td>-0.056870</td>\n",
       "      <td>...</td>\n",
       "      <td>0.721593</td>\n",
       "      <td>1.430621</td>\n",
       "      <td>1.561921</td>\n",
       "      <td>1.421526</td>\n",
       "      <td>-0.380755</td>\n",
       "      <td>0.995980</td>\n",
       "      <td>1.444831</td>\n",
       "      <td>-1.146292</td>\n",
       "      <td>-1.286884</td>\n",
       "      <td>0.399334</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160117000328</td>\n",
       "      <td>0.555709</td>\n",
       "      <td>0.799356</td>\n",
       "      <td>0.642238</td>\n",
       "      <td>-0.087123</td>\n",
       "      <td>0.329537</td>\n",
       "      <td>0.068898</td>\n",
       "      <td>0.031545</td>\n",
       "      <td>0.092615</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.351764</td>\n",
       "      <td>1.663539</td>\n",
       "      <td>1.669931</td>\n",
       "      <td>1.398735</td>\n",
       "      <td>-0.296376</td>\n",
       "      <td>-0.313423</td>\n",
       "      <td>1.652839</td>\n",
       "      <td>-0.018776</td>\n",
       "      <td>-0.108598</td>\n",
       "      <td>-0.426330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160118001751</td>\n",
       "      <td>0.747241</td>\n",
       "      <td>1.226816</td>\n",
       "      <td>0.694429</td>\n",
       "      <td>-0.289624</td>\n",
       "      <td>0.431144</td>\n",
       "      <td>0.233005</td>\n",
       "      <td>-0.282313</td>\n",
       "      <td>-0.078621</td>\n",
       "      <td>...</td>\n",
       "      <td>0.784198</td>\n",
       "      <td>1.663271</td>\n",
       "      <td>1.637793</td>\n",
       "      <td>1.390328</td>\n",
       "      <td>0.439459</td>\n",
       "      <td>0.610721</td>\n",
       "      <td>1.691506</td>\n",
       "      <td>1.473291</td>\n",
       "      <td>-0.296847</td>\n",
       "      <td>0.784690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160129000231</td>\n",
       "      <td>0.105170</td>\n",
       "      <td>0.018139</td>\n",
       "      <td>0.100484</td>\n",
       "      <td>-0.011982</td>\n",
       "      <td>0.454827</td>\n",
       "      <td>-0.465275</td>\n",
       "      <td>-0.591702</td>\n",
       "      <td>-0.185152</td>\n",
       "      <td>...</td>\n",
       "      <td>1.785259</td>\n",
       "      <td>0.335194</td>\n",
       "      <td>0.277705</td>\n",
       "      <td>0.253698</td>\n",
       "      <td>0.244954</td>\n",
       "      <td>2.071605</td>\n",
       "      <td>0.394051</td>\n",
       "      <td>0.785089</td>\n",
       "      <td>-1.584901</td>\n",
       "      <td>1.552762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160209000219</td>\n",
       "      <td>0.765320</td>\n",
       "      <td>1.096852</td>\n",
       "      <td>-0.939405</td>\n",
       "      <td>-1.414004</td>\n",
       "      <td>-0.625662</td>\n",
       "      <td>-0.791771</td>\n",
       "      <td>-0.856268</td>\n",
       "      <td>-0.876599</td>\n",
       "      <td>...</td>\n",
       "      <td>0.746315</td>\n",
       "      <td>0.425970</td>\n",
       "      <td>0.517158</td>\n",
       "      <td>0.824618</td>\n",
       "      <td>-0.684008</td>\n",
       "      <td>0.963349</td>\n",
       "      <td>0.439151</td>\n",
       "      <td>-0.809222</td>\n",
       "      <td>-1.930534</td>\n",
       "      <td>0.450210</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>571</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201220000450</td>\n",
       "      <td>0.945232</td>\n",
       "      <td>0.372686</td>\n",
       "      <td>0.611466</td>\n",
       "      <td>0.184055</td>\n",
       "      <td>0.386422</td>\n",
       "      <td>0.558708</td>\n",
       "      <td>-0.146063</td>\n",
       "      <td>0.075196</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.837161</td>\n",
       "      <td>-0.322822</td>\n",
       "      <td>-0.313229</td>\n",
       "      <td>-0.104117</td>\n",
       "      <td>-0.377032</td>\n",
       "      <td>-0.852519</td>\n",
       "      <td>-0.364279</td>\n",
       "      <td>-0.654146</td>\n",
       "      <td>0.533892</td>\n",
       "      <td>-0.764509</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>572</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201221000155</td>\n",
       "      <td>0.420034</td>\n",
       "      <td>0.388113</td>\n",
       "      <td>0.873211</td>\n",
       "      <td>0.402465</td>\n",
       "      <td>0.535511</td>\n",
       "      <td>0.437914</td>\n",
       "      <td>-0.250323</td>\n",
       "      <td>0.049582</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.002038</td>\n",
       "      <td>-0.766907</td>\n",
       "      <td>-0.777620</td>\n",
       "      <td>-0.369110</td>\n",
       "      <td>-0.398820</td>\n",
       "      <td>-0.984678</td>\n",
       "      <td>-0.817036</td>\n",
       "      <td>-0.081785</td>\n",
       "      <td>0.770268</td>\n",
       "      <td>-0.911390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>573</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201223000130</td>\n",
       "      <td>0.453630</td>\n",
       "      <td>0.117043</td>\n",
       "      <td>0.697612</td>\n",
       "      <td>0.481241</td>\n",
       "      <td>0.504346</td>\n",
       "      <td>0.603327</td>\n",
       "      <td>-0.100435</td>\n",
       "      <td>0.110774</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.509602</td>\n",
       "      <td>-1.004943</td>\n",
       "      <td>-0.998774</td>\n",
       "      <td>-0.575061</td>\n",
       "      <td>0.100536</td>\n",
       "      <td>-0.477078</td>\n",
       "      <td>-1.033329</td>\n",
       "      <td>0.054420</td>\n",
       "      <td>0.905942</td>\n",
       "      <td>-0.550365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>574</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201223002079</td>\n",
       "      <td>1.569819</td>\n",
       "      <td>1.169866</td>\n",
       "      <td>0.945060</td>\n",
       "      <td>-0.080142</td>\n",
       "      <td>0.211800</td>\n",
       "      <td>0.581094</td>\n",
       "      <td>0.464467</td>\n",
       "      <td>0.451214</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.978656</td>\n",
       "      <td>-0.219110</td>\n",
       "      <td>-0.291174</td>\n",
       "      <td>0.256401</td>\n",
       "      <td>-0.323638</td>\n",
       "      <td>-0.653136</td>\n",
       "      <td>-0.267405</td>\n",
       "      <td>0.626150</td>\n",
       "      <td>1.131021</td>\n",
       "      <td>-0.916144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>575</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201225000081</td>\n",
       "      <td>0.191324</td>\n",
       "      <td>-0.404957</td>\n",
       "      <td>-1.371552</td>\n",
       "      <td>-1.299280</td>\n",
       "      <td>-1.073156</td>\n",
       "      <td>-1.285365</td>\n",
       "      <td>-1.296397</td>\n",
       "      <td>-1.417198</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.646462</td>\n",
       "      <td>-0.886802</td>\n",
       "      <td>-0.942193</td>\n",
       "      <td>0.445530</td>\n",
       "      <td>-1.252410</td>\n",
       "      <td>-0.536959</td>\n",
       "      <td>-0.925252</td>\n",
       "      <td>0.718177</td>\n",
       "      <td>-1.595868</td>\n",
       "      <td>-0.708687</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>576 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     备注             流水号  original_shape_Elongation  original_shape_Flatness  \\\n",
       "0   NaN  20160117000135                   0.826613                 0.242068   \n",
       "1   NaN  20160117000328                   0.555709                 0.799356   \n",
       "2   NaN  20160118001751                   0.747241                 1.226816   \n",
       "3   NaN  20160129000231                   0.105170                 0.018139   \n",
       "4   NaN  20160209000219                   0.765320                 1.096852   \n",
       "..   ..             ...                        ...                      ...   \n",
       "571 NaN  20201220000450                   0.945232                 0.372686   \n",
       "572 NaN  20201221000155                   0.420034                 0.388113   \n",
       "573 NaN  20201223000130                   0.453630                 0.117043   \n",
       "574 NaN  20201223002079                   1.569819                 1.169866   \n",
       "575 NaN  20201225000081                   0.191324                -0.404957   \n",
       "\n",
       "     original_shape_LeastAxisLength  original_shape_MajorAxisLength  \\\n",
       "0                         -0.334582                       -0.579651   \n",
       "1                          0.642238                       -0.087123   \n",
       "2                          0.694429                       -0.289624   \n",
       "3                          0.100484                       -0.011982   \n",
       "4                         -0.939405                       -1.414004   \n",
       "..                              ...                             ...   \n",
       "571                        0.611466                        0.184055   \n",
       "572                        0.873211                        0.402465   \n",
       "573                        0.697612                        0.481241   \n",
       "574                        0.945060                       -0.080142   \n",
       "575                       -1.371552                       -1.299280   \n",
       "\n",
       "     original_shape_Maximum2DDiameterColumn  \\\n",
       "0                                  0.486115   \n",
       "1                                  0.329537   \n",
       "2                                  0.431144   \n",
       "3                                  0.454827   \n",
       "4                                 -0.625662   \n",
       "..                                      ...   \n",
       "571                                0.386422   \n",
       "572                                0.535511   \n",
       "573                                0.504346   \n",
       "574                                0.211800   \n",
       "575                               -1.073156   \n",
       "\n",
       "     original_shape_Maximum2DDiameterRow  \\\n",
       "0                              -0.222715   \n",
       "1                               0.068898   \n",
       "2                               0.233005   \n",
       "3                              -0.465275   \n",
       "4                              -0.791771   \n",
       "..                                   ...   \n",
       "571                             0.558708   \n",
       "572                             0.437914   \n",
       "573                             0.603327   \n",
       "574                             0.581094   \n",
       "575                            -1.285365   \n",
       "\n",
       "     original_shape_Maximum2DDiameterSlice  original_shape_Maximum3DDiameter  \\\n",
       "0                                -0.445211                         -0.056870   \n",
       "1                                 0.031545                          0.092615   \n",
       "2                                -0.282313                         -0.078621   \n",
       "3                                -0.591702                         -0.185152   \n",
       "4                                -0.856268                         -0.876599   \n",
       "..                                     ...                               ...   \n",
       "571                              -0.146063                          0.075196   \n",
       "572                              -0.250323                          0.049582   \n",
       "573                              -0.100435                          0.110774   \n",
       "574                               0.464467                          0.451214   \n",
       "575                              -1.296397                         -1.417198   \n",
       "\n",
       "     ...  NCCT_original_firstorder_MeanAbsoluteDeviation  \\\n",
       "0    ...                                        0.721593   \n",
       "1    ...                                       -0.351764   \n",
       "2    ...                                        0.784198   \n",
       "3    ...                                        1.785259   \n",
       "4    ...                                        0.746315   \n",
       "..   ...                                             ...   \n",
       "571  ...                                       -0.837161   \n",
       "572  ...                                       -1.002038   \n",
       "573  ...                                       -0.509602   \n",
       "574  ...                                       -0.978656   \n",
       "575  ...                                       -0.646462   \n",
       "\n",
       "     NCCT_original_firstorder_Mean  NCCT_original_firstorder_Median  \\\n",
       "0                         1.430621                         1.561921   \n",
       "1                         1.663539                         1.669931   \n",
       "2                         1.663271                         1.637793   \n",
       "3                         0.335194                         0.277705   \n",
       "4                         0.425970                         0.517158   \n",
       "..                             ...                              ...   \n",
       "571                      -0.322822                        -0.313229   \n",
       "572                      -0.766907                        -0.777620   \n",
       "573                      -1.004943                        -0.998774   \n",
       "574                      -0.219110                        -0.291174   \n",
       "575                      -0.886802                        -0.942193   \n",
       "\n",
       "     NCCT_original_firstorder_Minimum  NCCT_original_firstorder_Range  \\\n",
       "0                            1.421526                       -0.380755   \n",
       "1                            1.398735                       -0.296376   \n",
       "2                            1.390328                        0.439459   \n",
       "3                            0.253698                        0.244954   \n",
       "4                            0.824618                       -0.684008   \n",
       "..                                ...                             ...   \n",
       "571                         -0.104117                       -0.377032   \n",
       "572                         -0.369110                       -0.398820   \n",
       "573                         -0.575061                        0.100536   \n",
       "574                          0.256401                       -0.323638   \n",
       "575                          0.445530                       -1.252410   \n",
       "\n",
       "     NCCT_original_firstorder_RobustMeanAbsoluteDeviation  \\\n",
       "0                                             0.995980      \n",
       "1                                            -0.313423      \n",
       "2                                             0.610721      \n",
       "3                                             2.071605      \n",
       "4                                             0.963349      \n",
       "..                                                 ...      \n",
       "571                                          -0.852519      \n",
       "572                                          -0.984678      \n",
       "573                                          -0.477078      \n",
       "574                                          -0.653136      \n",
       "575                                          -0.536959      \n",
       "\n",
       "     NCCT_original_firstorder_RootMeanSquared  \\\n",
       "0                                    1.444831   \n",
       "1                                    1.652839   \n",
       "2                                    1.691506   \n",
       "3                                    0.394051   \n",
       "4                                    0.439151   \n",
       "..                                        ...   \n",
       "571                                 -0.364279   \n",
       "572                                 -0.817036   \n",
       "573                                 -1.033329   \n",
       "574                                 -0.267405   \n",
       "575                                 -0.925252   \n",
       "\n",
       "     NCCT_original_firstorder_Skewness  NCCT_original_firstorder_Uniformity  \\\n",
       "0                            -1.146292                            -1.286884   \n",
       "1                            -0.018776                            -0.108598   \n",
       "2                             1.473291                            -0.296847   \n",
       "3                             0.785089                            -1.584901   \n",
       "4                            -0.809222                            -1.930534   \n",
       "..                                 ...                                  ...   \n",
       "571                          -0.654146                             0.533892   \n",
       "572                          -0.081785                             0.770268   \n",
       "573                           0.054420                             0.905942   \n",
       "574                           0.626150                             1.131021   \n",
       "575                           0.718177                            -1.595868   \n",
       "\n",
       "     NCCT_original_firstorder_Variance  \n",
       "0                             0.399334  \n",
       "1                            -0.426330  \n",
       "2                             0.784690  \n",
       "3                             1.552762  \n",
       "4                             0.450210  \n",
       "..                                 ...  \n",
       "571                          -0.764509  \n",
       "572                          -0.911390  \n",
       "573                          -0.550365  \n",
       "574                          -0.916144  \n",
       "575                          -0.708687  \n",
       "\n",
       "[576 rows x 33 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "table4_columns_to_normalize = ['original_shape_Elongation', 'original_shape_Flatness', 'original_shape_LeastAxisLength','original_shape_MajorAxisLength',\n",
    "                               'original_shape_Maximum2DDiameterColumn', 'original_shape_Maximum2DDiameterRow', 'original_shape_Maximum2DDiameterSlice','original_shape_Maximum3DDiameter',\n",
    "                               'original_shape_MeshVolume', 'original_shape_MinorAxisLength', 'original_shape_Sphericity','original_shape_SurfaceArea',\n",
    "                               'original_shape_SurfaceVolumeRatio', 'original_shape_VoxelVolume', 'NCCT_original_firstorder_10Percentile','NCCT_original_firstorder_90Percentile',\n",
    "                               'NCCT_original_firstorder_Energy', 'NCCT_original_firstorder_Entropy', 'NCCT_original_firstorder_InterquartileRange','NCCT_original_firstorder_Kurtosis',\n",
    "                               'NCCT_original_firstorder_Maximum', 'NCCT_original_firstorder_MeanAbsoluteDeviation', 'NCCT_original_firstorder_Mean','NCCT_original_firstorder_Median',\n",
    "                               'NCCT_original_firstorder_Minimum', 'NCCT_original_firstorder_Range', 'NCCT_original_firstorder_RobustMeanAbsoluteDeviation','NCCT_original_firstorder_RootMeanSquared',\n",
    "                               'NCCT_original_firstorder_Skewness', 'NCCT_original_firstorder_Uniformity', 'NCCT_original_firstorder_Variance']\n",
    "table4[table4_columns_to_normalize] = scaler.fit_transform(table4[table4_columns_to_normalize])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>备注</th>\n",
       "      <th>流水号</th>\n",
       "      <th>original_shape_Elongation</th>\n",
       "      <th>original_shape_Flatness</th>\n",
       "      <th>original_shape_LeastAxisLength</th>\n",
       "      <th>original_shape_MajorAxisLength</th>\n",
       "      <th>original_shape_Maximum2DDiameterColumn</th>\n",
       "      <th>original_shape_Maximum2DDiameterRow</th>\n",
       "      <th>original_shape_Maximum2DDiameterSlice</th>\n",
       "      <th>original_shape_Maximum3DDiameter</th>\n",
       "      <th>...</th>\n",
       "      <th>NCCT_original_firstorder_MeanAbsoluteDeviation</th>\n",
       "      <th>NCCT_original_firstorder_Mean</th>\n",
       "      <th>NCCT_original_firstorder_Median</th>\n",
       "      <th>NCCT_original_firstorder_Minimum</th>\n",
       "      <th>NCCT_original_firstorder_Range</th>\n",
       "      <th>NCCT_original_firstorder_RobustMeanAbsoluteDeviation</th>\n",
       "      <th>NCCT_original_firstorder_RootMeanSquared</th>\n",
       "      <th>NCCT_original_firstorder_Skewness</th>\n",
       "      <th>NCCT_original_firstorder_Uniformity</th>\n",
       "      <th>NCCT_original_firstorder_Variance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160117000135</td>\n",
       "      <td>0.470279</td>\n",
       "      <td>-0.349903</td>\n",
       "      <td>0.715943</td>\n",
       "      <td>0.715876</td>\n",
       "      <td>1.071854</td>\n",
       "      <td>0.842209</td>\n",
       "      <td>0.591173</td>\n",
       "      <td>0.771240</td>\n",
       "      <td>...</td>\n",
       "      <td>1.146602</td>\n",
       "      <td>2.120730</td>\n",
       "      <td>2.137927</td>\n",
       "      <td>1.391119</td>\n",
       "      <td>0.253799</td>\n",
       "      <td>1.245727</td>\n",
       "      <td>2.084329</td>\n",
       "      <td>-1.055848</td>\n",
       "      <td>-0.605048</td>\n",
       "      <td>1.141033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160117000328</td>\n",
       "      <td>1.430333</td>\n",
       "      <td>-0.168871</td>\n",
       "      <td>0.667862</td>\n",
       "      <td>0.533027</td>\n",
       "      <td>1.380218</td>\n",
       "      <td>1.169794</td>\n",
       "      <td>0.652183</td>\n",
       "      <td>0.631717</td>\n",
       "      <td>...</td>\n",
       "      <td>1.376657</td>\n",
       "      <td>2.239293</td>\n",
       "      <td>2.134893</td>\n",
       "      <td>1.641984</td>\n",
       "      <td>0.439819</td>\n",
       "      <td>1.500219</td>\n",
       "      <td>2.212948</td>\n",
       "      <td>-0.919993</td>\n",
       "      <td>-0.531968</td>\n",
       "      <td>1.440704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160118001751</td>\n",
       "      <td>0.287755</td>\n",
       "      <td>-0.440588</td>\n",
       "      <td>0.621570</td>\n",
       "      <td>0.706711</td>\n",
       "      <td>1.088550</td>\n",
       "      <td>0.922549</td>\n",
       "      <td>0.333667</td>\n",
       "      <td>0.644035</td>\n",
       "      <td>...</td>\n",
       "      <td>0.956261</td>\n",
       "      <td>2.070851</td>\n",
       "      <td>2.132242</td>\n",
       "      <td>1.532024</td>\n",
       "      <td>0.173069</td>\n",
       "      <td>1.044546</td>\n",
       "      <td>2.024699</td>\n",
       "      <td>-1.291525</td>\n",
       "      <td>-0.437088</td>\n",
       "      <td>0.915814</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160129000231</td>\n",
       "      <td>-0.503236</td>\n",
       "      <td>-0.574061</td>\n",
       "      <td>0.076925</td>\n",
       "      <td>0.306986</td>\n",
       "      <td>0.795278</td>\n",
       "      <td>0.119957</td>\n",
       "      <td>-0.303859</td>\n",
       "      <td>0.028641</td>\n",
       "      <td>...</td>\n",
       "      <td>1.138101</td>\n",
       "      <td>1.752793</td>\n",
       "      <td>1.804535</td>\n",
       "      <td>1.070178</td>\n",
       "      <td>0.304828</td>\n",
       "      <td>1.257223</td>\n",
       "      <td>1.734426</td>\n",
       "      <td>-1.080765</td>\n",
       "      <td>-0.513544</td>\n",
       "      <td>1.123576</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20160209000219</td>\n",
       "      <td>-1.425061</td>\n",
       "      <td>-0.782636</td>\n",
       "      <td>-1.331031</td>\n",
       "      <td>-0.952362</td>\n",
       "      <td>-0.776474</td>\n",
       "      <td>-1.031634</td>\n",
       "      <td>-1.445025</td>\n",
       "      <td>-1.090590</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.715026</td>\n",
       "      <td>-0.353480</td>\n",
       "      <td>-0.492126</td>\n",
       "      <td>0.901116</td>\n",
       "      <td>-0.967604</td>\n",
       "      <td>-0.676599</td>\n",
       "      <td>-0.393158</td>\n",
       "      <td>0.797232</td>\n",
       "      <td>-0.392186</td>\n",
       "      <td>-0.858443</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>540</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201220000450</td>\n",
       "      <td>-0.956496</td>\n",
       "      <td>-0.039518</td>\n",
       "      <td>0.615259</td>\n",
       "      <td>0.398149</td>\n",
       "      <td>0.676786</td>\n",
       "      <td>0.864052</td>\n",
       "      <td>0.196375</td>\n",
       "      <td>0.266392</td>\n",
       "      <td>...</td>\n",
       "      <td>0.800326</td>\n",
       "      <td>0.258060</td>\n",
       "      <td>0.495483</td>\n",
       "      <td>-0.446307</td>\n",
       "      <td>-0.153453</td>\n",
       "      <td>0.935707</td>\n",
       "      <td>0.294650</td>\n",
       "      <td>-1.158505</td>\n",
       "      <td>-0.647541</td>\n",
       "      <td>0.683397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201221000155</td>\n",
       "      <td>-0.902321</td>\n",
       "      <td>0.094246</td>\n",
       "      <td>0.679709</td>\n",
       "      <td>0.361695</td>\n",
       "      <td>0.581819</td>\n",
       "      <td>0.698625</td>\n",
       "      <td>-0.164125</td>\n",
       "      <td>0.148277</td>\n",
       "      <td>...</td>\n",
       "      <td>0.475468</td>\n",
       "      <td>-0.172821</td>\n",
       "      <td>0.067430</td>\n",
       "      <td>-0.701320</td>\n",
       "      <td>-0.205794</td>\n",
       "      <td>0.591256</td>\n",
       "      <td>-0.137548</td>\n",
       "      <td>-1.052151</td>\n",
       "      <td>-0.611751</td>\n",
       "      <td>0.305658</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>542</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201223000130</td>\n",
       "      <td>-1.186191</td>\n",
       "      <td>-0.063415</td>\n",
       "      <td>0.635930</td>\n",
       "      <td>0.431367</td>\n",
       "      <td>0.594261</td>\n",
       "      <td>0.652826</td>\n",
       "      <td>-0.435644</td>\n",
       "      <td>0.146519</td>\n",
       "      <td>...</td>\n",
       "      <td>0.313905</td>\n",
       "      <td>-0.219110</td>\n",
       "      <td>0.097978</td>\n",
       "      <td>-0.967488</td>\n",
       "      <td>-0.414791</td>\n",
       "      <td>0.409430</td>\n",
       "      <td>-0.194624</td>\n",
       "      <td>-1.291699</td>\n",
       "      <td>-0.582488</td>\n",
       "      <td>0.118091</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>543</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201223002079</td>\n",
       "      <td>0.051570</td>\n",
       "      <td>0.354130</td>\n",
       "      <td>-1.081206</td>\n",
       "      <td>-1.097400</td>\n",
       "      <td>-1.271074</td>\n",
       "      <td>-1.304030</td>\n",
       "      <td>-0.279926</td>\n",
       "      <td>-0.539540</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.814824</td>\n",
       "      <td>-1.800889</td>\n",
       "      <td>-1.775371</td>\n",
       "      <td>-0.103490</td>\n",
       "      <td>-1.889127</td>\n",
       "      <td>-1.558610</td>\n",
       "      <td>-1.845595</td>\n",
       "      <td>0.830644</td>\n",
       "      <td>0.064635</td>\n",
       "      <td>-1.708411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>544</th>\n",
       "      <td>NaN</td>\n",
       "      <td>20201225000081</td>\n",
       "      <td>-0.802152</td>\n",
       "      <td>-0.124786</td>\n",
       "      <td>-0.750575</td>\n",
       "      <td>-0.683214</td>\n",
       "      <td>-0.657389</td>\n",
       "      <td>-0.553052</td>\n",
       "      <td>-0.911592</td>\n",
       "      <td>-0.663926</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.694378</td>\n",
       "      <td>-1.268336</td>\n",
       "      <td>-1.300132</td>\n",
       "      <td>-0.038716</td>\n",
       "      <td>-0.636815</td>\n",
       "      <td>-0.640458</td>\n",
       "      <td>-1.261964</td>\n",
       "      <td>0.920226</td>\n",
       "      <td>0.176016</td>\n",
       "      <td>-0.848003</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>545 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     备注             流水号  original_shape_Elongation  original_shape_Flatness  \\\n",
       "0   NaN  20160117000135                   0.470279                -0.349903   \n",
       "1   NaN  20160117000328                   1.430333                -0.168871   \n",
       "2   NaN  20160118001751                   0.287755                -0.440588   \n",
       "3   NaN  20160129000231                  -0.503236                -0.574061   \n",
       "4   NaN  20160209000219                  -1.425061                -0.782636   \n",
       "..   ..             ...                        ...                      ...   \n",
       "540 NaN  20201220000450                  -0.956496                -0.039518   \n",
       "541 NaN  20201221000155                  -0.902321                 0.094246   \n",
       "542 NaN  20201223000130                  -1.186191                -0.063415   \n",
       "543 NaN  20201223002079                   0.051570                 0.354130   \n",
       "544 NaN  20201225000081                  -0.802152                -0.124786   \n",
       "\n",
       "     original_shape_LeastAxisLength  original_shape_MajorAxisLength  \\\n",
       "0                          0.715943                        0.715876   \n",
       "1                          0.667862                        0.533027   \n",
       "2                          0.621570                        0.706711   \n",
       "3                          0.076925                        0.306986   \n",
       "4                         -1.331031                       -0.952362   \n",
       "..                              ...                             ...   \n",
       "540                        0.615259                        0.398149   \n",
       "541                        0.679709                        0.361695   \n",
       "542                        0.635930                        0.431367   \n",
       "543                       -1.081206                       -1.097400   \n",
       "544                       -0.750575                       -0.683214   \n",
       "\n",
       "     original_shape_Maximum2DDiameterColumn  \\\n",
       "0                                  1.071854   \n",
       "1                                  1.380218   \n",
       "2                                  1.088550   \n",
       "3                                  0.795278   \n",
       "4                                 -0.776474   \n",
       "..                                      ...   \n",
       "540                                0.676786   \n",
       "541                                0.581819   \n",
       "542                                0.594261   \n",
       "543                               -1.271074   \n",
       "544                               -0.657389   \n",
       "\n",
       "     original_shape_Maximum2DDiameterRow  \\\n",
       "0                               0.842209   \n",
       "1                               1.169794   \n",
       "2                               0.922549   \n",
       "3                               0.119957   \n",
       "4                              -1.031634   \n",
       "..                                   ...   \n",
       "540                             0.864052   \n",
       "541                             0.698625   \n",
       "542                             0.652826   \n",
       "543                            -1.304030   \n",
       "544                            -0.553052   \n",
       "\n",
       "     original_shape_Maximum2DDiameterSlice  original_shape_Maximum3DDiameter  \\\n",
       "0                                 0.591173                          0.771240   \n",
       "1                                 0.652183                          0.631717   \n",
       "2                                 0.333667                          0.644035   \n",
       "3                                -0.303859                          0.028641   \n",
       "4                                -1.445025                         -1.090590   \n",
       "..                                     ...                               ...   \n",
       "540                               0.196375                          0.266392   \n",
       "541                              -0.164125                          0.148277   \n",
       "542                              -0.435644                          0.146519   \n",
       "543                              -0.279926                         -0.539540   \n",
       "544                              -0.911592                         -0.663926   \n",
       "\n",
       "     ...  NCCT_original_firstorder_MeanAbsoluteDeviation  \\\n",
       "0    ...                                        1.146602   \n",
       "1    ...                                        1.376657   \n",
       "2    ...                                        0.956261   \n",
       "3    ...                                        1.138101   \n",
       "4    ...                                       -0.715026   \n",
       "..   ...                                             ...   \n",
       "540  ...                                        0.800326   \n",
       "541  ...                                        0.475468   \n",
       "542  ...                                        0.313905   \n",
       "543  ...                                       -1.814824   \n",
       "544  ...                                       -0.694378   \n",
       "\n",
       "     NCCT_original_firstorder_Mean  NCCT_original_firstorder_Median  \\\n",
       "0                         2.120730                         2.137927   \n",
       "1                         2.239293                         2.134893   \n",
       "2                         2.070851                         2.132242   \n",
       "3                         1.752793                         1.804535   \n",
       "4                        -0.353480                        -0.492126   \n",
       "..                             ...                              ...   \n",
       "540                       0.258060                         0.495483   \n",
       "541                      -0.172821                         0.067430   \n",
       "542                      -0.219110                         0.097978   \n",
       "543                      -1.800889                        -1.775371   \n",
       "544                      -1.268336                        -1.300132   \n",
       "\n",
       "     NCCT_original_firstorder_Minimum  NCCT_original_firstorder_Range  \\\n",
       "0                            1.391119                        0.253799   \n",
       "1                            1.641984                        0.439819   \n",
       "2                            1.532024                        0.173069   \n",
       "3                            1.070178                        0.304828   \n",
       "4                            0.901116                       -0.967604   \n",
       "..                                ...                             ...   \n",
       "540                         -0.446307                       -0.153453   \n",
       "541                         -0.701320                       -0.205794   \n",
       "542                         -0.967488                       -0.414791   \n",
       "543                         -0.103490                       -1.889127   \n",
       "544                         -0.038716                       -0.636815   \n",
       "\n",
       "     NCCT_original_firstorder_RobustMeanAbsoluteDeviation  \\\n",
       "0                                             1.245727      \n",
       "1                                             1.500219      \n",
       "2                                             1.044546      \n",
       "3                                             1.257223      \n",
       "4                                            -0.676599      \n",
       "..                                                 ...      \n",
       "540                                           0.935707      \n",
       "541                                           0.591256      \n",
       "542                                           0.409430      \n",
       "543                                          -1.558610      \n",
       "544                                          -0.640458      \n",
       "\n",
       "     NCCT_original_firstorder_RootMeanSquared  \\\n",
       "0                                    2.084329   \n",
       "1                                    2.212948   \n",
       "2                                    2.024699   \n",
       "3                                    1.734426   \n",
       "4                                   -0.393158   \n",
       "..                                        ...   \n",
       "540                                  0.294650   \n",
       "541                                 -0.137548   \n",
       "542                                 -0.194624   \n",
       "543                                 -1.845595   \n",
       "544                                 -1.261964   \n",
       "\n",
       "     NCCT_original_firstorder_Skewness  NCCT_original_firstorder_Uniformity  \\\n",
       "0                            -1.055848                            -0.605048   \n",
       "1                            -0.919993                            -0.531968   \n",
       "2                            -1.291525                            -0.437088   \n",
       "3                            -1.080765                            -0.513544   \n",
       "4                             0.797232                            -0.392186   \n",
       "..                                 ...                                  ...   \n",
       "540                          -1.158505                            -0.647541   \n",
       "541                          -1.052151                            -0.611751   \n",
       "542                          -1.291699                            -0.582488   \n",
       "543                           0.830644                             0.064635   \n",
       "544                           0.920226                             0.176016   \n",
       "\n",
       "     NCCT_original_firstorder_Variance  \n",
       "0                             1.141033  \n",
       "1                             1.440704  \n",
       "2                             0.915814  \n",
       "3                             1.123576  \n",
       "4                            -0.858443  \n",
       "..                                 ...  \n",
       "540                           0.683397  \n",
       "541                           0.305658  \n",
       "542                           0.118091  \n",
       "543                          -1.708411  \n",
       "544                          -0.848003  \n",
       "\n",
       "[545 rows x 33 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "sub100_patients = ['sub{:03d}'.format(i) for i in range(1, 101)]\n",
    "\n",
    "        \n",
    "table1_sub100 = table1[table1['ID'].isin(sub100_patients)]\n",
    "table2_sub100 = table2[table2['首次检查流水号'].isin(table1_sub100['入院首次影像检查流水号'])]\n",
    "table3_sub100 = table3[table3['流水号'].isin(table1_sub100['入院首次影像检查流水号'])]\n",
    "table4_sub100 = table4[table4['流水号'].isin(table1_sub100['入院首次影像检查流水号'])]\n",
    "data = table1_sub100.merge(table2_sub100, left_on='入院首次影像检查流水号', right_on='首次检查流水号', how='inner')\n",
    "data = data.merge(table3_sub100, left_on='入院首次影像检查流水号', right_on='流水号', how='inner')\n",
    "data = data.merge(table4_sub100, left_on='入院首次影像检查流水号', right_on='流水号', how='inner')\n",
    "\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>90天mRS</th>\n",
       "      <th>数据集划分</th>\n",
       "      <th>入院首次影像检查流水号</th>\n",
       "      <th>年龄</th>\n",
       "      <th>性别</th>\n",
       "      <th>脑出血前mRS评分</th>\n",
       "      <th>高血压病史</th>\n",
       "      <th>卒中病史</th>\n",
       "      <th>糖尿病史</th>\n",
       "      <th>...</th>\n",
       "      <th>血压</th>\n",
       "      <th>脑室引流</th>\n",
       "      <th>止血治疗</th>\n",
       "      <th>降颅压治疗</th>\n",
       "      <th>降压治疗</th>\n",
       "      <th>镇静、镇痛治疗</th>\n",
       "      <th>止吐护胃</th>\n",
       "      <th>营养神经</th>\n",
       "      <th>高压</th>\n",
       "      <th>低压</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sub001</td>\n",
       "      <td>4.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>43</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>180/90</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>180</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sub002</td>\n",
       "      <td>0.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20160406002131</td>\n",
       "      <td>58</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>199/120</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>199</td>\n",
       "      <td>120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sub003</td>\n",
       "      <td>5.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20160413000006</td>\n",
       "      <td>78</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>199/120</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>199</td>\n",
       "      <td>120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sub004</td>\n",
       "      <td>4.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161215001667</td>\n",
       "      <td>70</td>\n",
       "      <td>男</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>186/99</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>186</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sub005</td>\n",
       "      <td>3.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20161222000978</td>\n",
       "      <td>51</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>135/92</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>135</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>sub096</td>\n",
       "      <td>4.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180802001789</td>\n",
       "      <td>93</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>181/76</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>181</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>sub097</td>\n",
       "      <td>2.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20181010000767</td>\n",
       "      <td>83</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>170/79</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>170</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>sub098</td>\n",
       "      <td>5.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180612002507</td>\n",
       "      <td>82</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>200/100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>200</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>sub099</td>\n",
       "      <td>3.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180620002296</td>\n",
       "      <td>53</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>159/91</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>159</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>sub100</td>\n",
       "      <td>2.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180314000010</td>\n",
       "      <td>80</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>152/80</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>152</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        ID  90天mRS 数据集划分     入院首次影像检查流水号  年龄 性别  脑出血前mRS评分  高血压病史  卒中病史  糖尿病史  \\\n",
       "0   sub001     4.0    训练  20161212002136  43  女          0      0     0     0   \n",
       "1   sub002     0.0    训练  20160406002131  58  男          0      1     0     0   \n",
       "2   sub003     5.0    训练  20160413000006  78  男          0      1     0     0   \n",
       "3   sub004     4.0    训练  20161215001667  70  男          2      1     1     0   \n",
       "4   sub005     3.0    训练  20161222000978  51  男          0      0     0     0   \n",
       "..     ...     ...   ...             ...  .. ..        ...    ...   ...   ...   \n",
       "95  sub096     4.0    训练  20180802001789  93  女          0      0     0     0   \n",
       "96  sub097     2.0    训练  20181010000767  83  女          0      1     0     0   \n",
       "97  sub098     5.0    训练  20180612002507  82  男          0      1     1     1   \n",
       "98  sub099     3.0    训练  20180620002296  53  男          0      1     0     0   \n",
       "99  sub100     2.0    训练  20180314000010  80  男          0      0     0     0   \n",
       "\n",
       "    ...       血压  脑室引流  止血治疗  降颅压治疗  降压治疗 镇静、镇痛治疗  止吐护胃  营养神经   高压   低压  \n",
       "0   ...   180/90     0     1      1     1       1     1     1  180   90  \n",
       "1   ...  199/120     0     1      1     1       0     1     1  199  120  \n",
       "2   ...  199/120     0     1      1     1       1     1     1  199  120  \n",
       "3   ...   186/99     0     1      1     1       0     0     0  186   99  \n",
       "4   ...   135/92     0     1      1     0       0     1     1  135   92  \n",
       "..  ...      ...   ...   ...    ...   ...     ...   ...   ...  ...  ...  \n",
       "95  ...   181/76     0     0      0     1       1     1     1  181   76  \n",
       "96  ...   170/79     0     1      1     1       1     1     1  170   79  \n",
       "97  ...  200/100     0     1      1     1       1     1     1  200  100  \n",
       "98  ...   159/91     1     1      1     1       1     1     1  159   91  \n",
       "99  ...   152/80     0     1      1     1       1     1     1  152   80  \n",
       "\n",
       "[100 rows x 25 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table1_sub100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# data = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/第三问c.xlsx')\n",
    "data = pd.get_dummies(data, columns=['性别'], drop_first=True)\n",
    "data.to_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/第三问c_首次.xlsx', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_excel('/braindat/lab/wuxl/code/shumo/jianmo2023/竞赛发布数据/第三问b_2.xlsx')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建一个空的时间序列数据集\n",
    "time_series_dataset = []\n",
    "\n",
    "# 初始化变量以跟踪当前ID和连续计数\n",
    "current_id = None\n",
    "count = 0\n",
    "time_series = []\n",
    "\n",
    "# 遍历数据\n",
    "for index, row in data.iterrows():\n",
    "    # 获取当前行的ID\n",
    "    current_row_id = row['ID']\n",
    "\n",
    "    # 如果ID与上一个数据点相同，将其添加到当前时间序列\n",
    "    if current_row_id == current_id:\n",
    "        current_data = row.drop(['ID'])  # 去除ID列\n",
    "        time_series.append(current_data.values)\n",
    "        count += 1\n",
    "    else:\n",
    "        # 如果ID与上一个数据点不同，检查时间序列的长度\n",
    "        if count >= 1:  # 只添加包含1到9个数据点的时间序列\n",
    "            time_series_dataset.append(time_series.copy())\n",
    "        # 重置时间序列和计数\n",
    "        time_series = [row.drop(['ID']).values]\n",
    "        count = 1\n",
    "        current_id = current_row_id\n",
    "\n",
    "# 添加最后一个时间序列（如果有的话）\n",
    "if count >= 1:\n",
    "    time_series_dataset.append(time_series.copy())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第一个时间序列数据:\n",
      "[array([1.107760108711707, -0.360671021196119, 1.421207149779929,\n",
      "       0.04602528680580984, -0.2066337285136349, -0.1291359503369199,\n",
      "       -0.3527836515578177, -0.7633323803371348, -0.5474197694140784,\n",
      "       -0.2615437371399804, -0.09841321617980121, 0.909174840523781,\n",
      "       0.4974535152435355, 0.9970605866618831, 0.4832664622697062,\n",
      "       -0.1605498762075249, -0.1216198061702702, -0.5025435883225464,\n",
      "       -0.8730678362627107, -0.6794973318480553, -0.2097740905971871,\n",
      "       -0.08583857622508813, -1.51781868498753, -0.2487820177430174, 1,\n",
      "       0.3977628220899492, -0.2851480283979899, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
      "       0, 0, 0, 1, 1, 1, 1, 1, 0.5024809776223433, -0.4144509554855094,\n",
      "       0.374824866989628, 0.7071066154543991, 0.3771531464118873,\n",
      "       0.5396440623768661, 0.3839140559890601, 0.263028557224646,\n",
      "       0.4894782879653126, 1.275033188290092, -0.8026496950229318,\n",
      "       0.9629660720836037, -0.4175175350421667, 0.5002351014444297,\n",
      "       0.5990076953239686, 0.7620970769773835, 1.125587438277308,\n",
      "       -0.3578504213497706, 0.05365753242236008, 1.381413731617305,\n",
      "       0.5326104250666396, 0.388179658326233, 0.7648118209498895,\n",
      "       0.8353019700037098, -0.1260674646709927, 0.5097076701273444,\n",
      "       0.1475226858404937, 0.7771347083516962, -2.055892989228714,\n",
      "       0.5591367627878138, 0.4267690116469096, 0.8035470750248045,\n",
      "       0.3620237104741439, 0.6204091942400106, 0.1566738010096668,\n",
      "       0.4842544739583133, 0.473651790945977, 0.07324606270054225,\n",
      "       0.267398435231413, 0.904026988839649, 0.8057350441894624,\n",
      "       0.8910754178286171, 0.4115930603775809, -0.4648459840500224,\n",
      "       0.9030483245196534, 1.174138488384345, 1.20616812897806,\n",
      "       1.483870093881485, 0.3241191536550753, 0.3709419274648264,\n",
      "       -0.1089785502562255, 0.5581458518183341, 0.5986657492141608,\n",
      "       1.628632028124341, 1.916249505818048, 0.7341804562243518,\n",
      "       0.2913111323639085, 0.4537729903624517, 1.590600690115811,\n",
      "       -1.926965813779835, -0.1951488337589617, 0.6656116999308616, 4],\n",
      "      dtype=object), array([1.261933118391331, -0.3594718281671244, 1.402162910455773,\n",
      "       0.07675200424411135, -0.2066337285136349, -0.1291359503369199,\n",
      "       -0.3527836515578177, -0.7633323803371348, -0.5474197694140784,\n",
      "       -0.2615437371399804, -0.09841321617980121, 1.260773286034463,\n",
      "       0.4086100383456411, 1.151096558103735, 0.1236172908520465,\n",
      "       -0.1517186298052249, -0.1216198061702702, -0.5025435883225464,\n",
      "       -0.8730678362627107, -0.6794973318480553, -0.2097740905971871,\n",
      "       -0.08583857622508813, -1.51781868498753, -0.2487820177430174, 1,\n",
      "       0.3977628220899492, -0.2851480283979899, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
      "       0, 0, 0, 1, 1, 1, 1, 1, 0.3490400247630069, -0.1429610242671779,\n",
      "       0.7760636795648191, 0.8272767724842949, 0.3844097445222888,\n",
      "       0.5018770020622961, 0.3283599235494126, 0.4497010779438348,\n",
      "       0.7652571392736549, 1.291449710848039, -0.9570560550945336,\n",
      "       1.393930987930582, -0.4239305435393705, 0.7664825997673678,\n",
      "       1.387497736687739, 1.307297857779302, 2.123576556692381,\n",
      "       -0.9112592105978972, -0.07943141592337656, 0.8651608398370428,\n",
      "       1.358224794755294, 0.006385083283253028, 1.380502864264434,\n",
      "       1.38206738632908, 0.7245930558469623, 0.5971175965029305,\n",
      "       -0.09381545260042541, 1.380285435833896, -0.6235357804757631,\n",
      "       1.0307488681787, -0.01824107745424295, 0.6451824920275481,\n",
      "       0.1140649320832111, 0.6040909654504227, 0.2896938744212619,\n",
      "       0.5463697561011325, 0.3628599489990325, 0.1730581021346166,\n",
      "       0.3109637930746316, 1.052638265337596, 0.8967041886436568,\n",
      "       0.7726384722413177, 0.5243940025107432, -0.4682048114595974,\n",
      "       1.051034239802647, 1.727479371207828, 1.751322519993382,\n",
      "       2.061268337130012, 0.2659053443471866, 0.7878482014756326,\n",
      "       -0.2030001448479989, 0.8532894470765188, 1.025994221604598,\n",
      "       2.273334031959076, 2.57998936803052, 0.9583501807647411,\n",
      "       0.5048195366226261, 0.90974318636303, 2.231388848409549,\n",
      "       -2.008419791976754, -0.0713430786720022, 1.181717756025851, 4],\n",
      "      dtype=object), array([1.144550044329166, -0.3455201110000484, 1.267264946243661,\n",
      "       0.2845625972319124, -0.2066337285136349, -0.1291359503369199,\n",
      "       -0.3527836515578177, -0.7633323803371348, -0.5474197694140784,\n",
      "       -0.2615437371399804, -0.09841321617980121, 2.194649143811973,\n",
      "       0.8347010312793577, 0.8764439158625299, 0.592536553473424,\n",
      "       0.01958849365278369, -0.1216198061702702, -0.5025435883225464,\n",
      "       -0.8730678362627107, -0.6794973318480553, -0.2097740905971871,\n",
      "       -0.08583857622508813, -1.51781868498753, -0.2487820177430174, 1,\n",
      "       0.3977628220899492, -0.2851480283979899, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
      "       0, 0, 0, 1, 1, 1, 1, 1, 0.489024048774425, 0.2818710527005912,\n",
      "       1.066394267951981, 0.6697262266353238, 0.4658148517221238,\n",
      "       0.7575338065324239, 0.631578844365685, 0.4098443081068927,\n",
      "       1.668401680605848, 1.217716495501808, -0.5156276706786953,\n",
      "       1.800275602095877, -0.686814653121768, 1.66967603638595,\n",
      "       -0.04835067634864362, 0.55563590005294, 2.162954502148861,\n",
      "       0.1711431893401995, 1.550032626597198, -1.254631143517594,\n",
      "       0.8432010957483128, 1.301831316451677, 0.2806150936800906,\n",
      "       0.2924546506610935, -0.1753202377618106, 0.7906439015975543,\n",
      "       1.47877148777167, 0.3209093723343507, 0.5262608786591286,\n",
      "       -0.4409598362697584, 1.09016649418695, 0.4980959053725038,\n",
      "       -0.1003354682430514, 0.4690373006888786, 0.318614538124883,\n",
      "       0.3721683998910988, 0.5119816358889799, 0.1963750525581817,\n",
      "       0.3508956012218072, 0.9037113979082245, 0.8416833818789619,\n",
      "       0.4411870660573224, 0.5248317901230863, -0.4336986139554053,\n",
      "       0.9040526201523125, 1.07930606223247, 1.165452341249688,\n",
      "       1.457381734656452, 0.449251154976315, 0.5635828217266874,\n",
      "       -0.2758260754032458, 0.3577329925441852, 0.7201568277849835,\n",
      "       1.569909560331458, 1.863175166345019, 0.4509791866443185,\n",
      "       0.1938072579018134, 0.6418267814554341, 1.539936923733762,\n",
      "       -1.835440871596501, -0.2852383639302367, 0.754141520601311, 4],\n",
      "      dtype=object), array([0.9032163875041417, -0.3090194664321097, 1.232517964829516,\n",
      "       0.3444465897768961, -0.2049694341600753, -0.1291359503369199,\n",
      "       -0.3527836515578177, -0.7633323803371348, -0.5474197694140784,\n",
      "       -0.2615437371399804, -0.09841321617980121, 3.214554825042759,\n",
      "       1.449126172004274, 0.6517291161867771, 0.5281620211295751,\n",
      "       0.3704011228075139, -0.1216198061702702, -0.5025435883225464,\n",
      "       -0.8730678362627107, -0.6794973318480553, -0.2097740905971871,\n",
      "       -0.08583857622508813, -1.51781868498753, -0.2487820177430174, 1,\n",
      "       0.3977628220899492, -0.2851480283979899, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
      "       0, 0, 0, 1, 1, 1, 1, 1, 0.2831069914047457, 0.7148518651460523,\n",
      "       1.751750807971367, 0.8587217292156603, 0.6571266941700268,\n",
      "       0.666131393552061, 0.6143600443990774, 0.795402316818866,\n",
      "       2.600853981371132, 1.271721694291148, -0.4873251451769862,\n",
      "       2.475416045077078, -0.7687084467459915, 2.59761000977177,\n",
      "       0.06958210881607975, 0.4670065483491644, 3.278421459355829,\n",
      "       0.5006528723509296, 0.9833003842708871, -1.183400141820637,\n",
      "       0.3065799556298557, 0.8065674494171297, 0.3093671224904077,\n",
      "       0.3287867472478575, 0.009260208068101993, 0.2384297510633591,\n",
      "       0.9527403052031046, 0.3280529244370992, 0.08114636405141973,\n",
      "       -0.7024935867239822, 0.5762596831616041, 0.2125615400539087,\n",
      "       0.0229898583420114, 0.4418588939322446, 0.2173896582389956,\n",
      "       0.1716799334799068, 0.3369532075618489, 0.02971676429980966,\n",
      "       0.2717545261145502, 0.6878472008124482, 0.5246809056960378,\n",
      "       0.935894788061762, 0.27732463211119, -0.4497213427559174,\n",
      "       0.6870066110705891, 0.621180618261031, 1.051419577530748,\n",
      "       0.9312510504151187, 0.7969217408379987, 1.000318128129875,\n",
      "       -0.6831393246848705, 0.4090309637137474, 0.9437810061930679,\n",
      "       0.9779669513149795, 0.9534904028064186, 0.2905798123044545,\n",
      "       0.3031771302986956, 0.9746957687276568, 0.9918089008573046,\n",
      "       -0.5333414611354588, -0.805667057644994, 0.9623447815667093, 4],\n",
      "      dtype=object), array([0.3444729549682347, -0.3597038320989475, 1.314697723495253,\n",
      "       0.2273313919490516, -0.2066337285136349, -0.1291359503369199,\n",
      "       -0.3527836515578177, -0.7633323803371348, -0.5474197694140784,\n",
      "       -0.2615437371399804, -0.09841321617980121, 3.949352110932942,\n",
      "       1.05023430802136, 0.8421736643100085, 0.4039838289497916,\n",
      "       0.3576648733310329, -0.1216198061702702, -0.5025435883225464,\n",
      "       -0.8730678362627107, -0.6793129569179908, -0.2097740905971871,\n",
      "       -0.08583857622508813, -1.51781868498753, -0.2487820177430174, 1,\n",
      "       0.3977628220899492, -0.2851480283979899, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
      "       0, 0, 0, 1, 1, 1, 1, 1, -0.03120212595335147, 0.6449922593444506,\n",
      "       1.835953299161341, 0.9907725864217881, 0.4938860717672909,\n",
      "       1.330036349802872, 0.8194207966518966, 1.028227924701169,\n",
      "       3.110357843191741, 1.143252051889807, -0.5816386900413286,\n",
      "       2.955948937272707, -0.7794614736487497, 3.101350276598769,\n",
      "       0.5298200707618123, 0.5660378946543625, 4.331799190113747,\n",
      "       0.06800218916657108, 0.2889783123229645, -0.9750374426399876,\n",
      "       0.2996402452370883, 0.1202828919775972, 0.5467508445254271,\n",
      "       0.5203215423405584, 0.3337638682987553, 0.01490741848078011,\n",
      "       0.2444886913698427, 0.5390424289397607, 0.6325509394138672,\n",
      "       -0.2934047072584571, -0.07288101685699731, 0.3674010882417054,\n",
      "       0.03882797850769324, 0.0300214644859295, -0.1216799009890386,\n",
      "       -0.1280592872139544, 0.1063072391629538, -0.207836761661935,\n",
      "       -0.3103842669168683, 0.1218595208404044, 0.1684508803007738,\n",
      "       1.378835740805547, -0.1434148145980255, -0.4152150332497075,\n",
      "       0.1205838742508931, 0.4737656646559754, 0.5510967536252682,\n",
      "       0.140749176595583, 0.7194889033132854, 0.2825527690145518,\n",
      "       -0.3589023481723742, 0.1991018924609317, 0.2955969425246054,\n",
      "       0.402777577637034, 0.251789201606325, 0.8066012492979369,\n",
      "       -0.09351707612654013, 0.2669401256005772, 0.4006360341699003,\n",
      "       0.2784895976560746, -0.7020981466775315, 0.2224745483005257, 4],\n",
      "      dtype=object)]\n"
     ]
    }
   ],
   "source": [
    "print(\"第一个时间序列数据:\")\n",
    "print(time_series_dataset[0])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.13"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
